**************************
*** Study 3 - Analyses ***
**************************

* setting directory
cd "~/dropbox/Moral decoupling/Study 3 - Gaetz  2021 CES"

* load data
use "Study_3_data.dta", clear


****************************
** Descriptive statistics **
****************************

sum age
tab gender4 /*56.1% women*/
tab educ /*48.4% completed an academic degree (+21.2% who completed some college)*/
tab race /*67.3% are non-Hispanic White*/

tab republican, miss /*46.5% Democrats; 32.6% Republicans */



*** Main variables ***
tab DV, miss
tab relevance, miss
sum DV relevance


** Overall difference b/w Democrats and Republicans **
ttest DV, by (republican)
esize twosample DV, by (republican) /* Cohen d = 0.28 */

* with non-partisans
oneway DV partisan_group, t sch


* Relevance evaluations
ttest relevance, by (republican)
esize twosample relevance, by (republican) /* Cohen d = 0.98 */

* with non-partisans
oneway relevance partisan_group, t sch



****************************
*** Experimental results ***
****************************

** Table 3 - Model 1 - only among Republicans
reg DV i.treatment if republican==1, r
outreg2 using Table_3.doc, replace se dec(2) alpha (.001, .01, .05) ///
symbol (***, **, *) 


** Table 3 - Model 2 - Only among Democrats
reg DV i.treatment if republican==0, r
outreg2 using Table_3.doc, append se dec(2) alpha (.001, .01, .05) ///
symbol (***, **, *) 


** Table 3 - Model 3 - All respondents
reg DV i.treatment##i.republican, r
outreg2 using Table_3.doc, append se dec(2) alpha (.001, .01, .05) ///
symbol (***, **, *) 


* Figure 3
cibar DV, over1(treatment) over2(republican) level(95) barcol(black gs14) graphopts(ylabel(,) graphregion(color(white)) ytitle("Inappropriateness of transgression")) 



**********************
** Robustness tests **
**********************

** Table A8 - Treating "don't know" responses as mid-point **
gen DV_w_DK=DV
recode DV_w_DK (.=4)

** Model 1 - only among Republicans
reg DV_w_DK treatment if republican==1, r
outreg2 using Table_A8.doc, replace se dec(2) alpha (.001, .01, .05) ///
symbol (***, **, *) 

** Model 2 - Only among Democrats
reg DV_w_DK treatment if republican==0, r
outreg2 using Table_A8.doc, append se dec(2) alpha (.001, .01, .05) ///
symbol (***, **, *) 

** Model 3 - All respondents - with an interaction b/w the treatment and Republicans
reg DV_w_DK i.treatment##i.republican, r
outreg2 using Table_A8.doc, append se dec(2) alpha (.001, .01, .05) ///
symbol (***, **, *) 

drop DV_w_DK


*******************
** Balance tests **
*******************

ttest age, by (treatment) /* p=.164*/
ttest time, by (treatment) /* p=.980*/

tab gender4 treatment, exact chi col /* p=.351*/
recode race (1=1) (2/7=0), gen(white)
tab white treatment, chi col /* p=.907*/
tab educ treatment, chi col /* p=.393*/
tab republican treatment, chi col /* p=.737*/
tab pid7 treatment, chi col /* p=.248*/

logit treatment age i.gender4 white educ republican, r  /* p=.754*/
drop white
